package me.gavin.net

import okhttp3.ResponseBody
import retrofit2.http.*

interface ClientAPI {

    @GET
    suspend fun get(
            @Url url: String,
            @HeaderMap headers: Map<String, String> = emptyMap(),
            @QueryMap map: Map<String, String> = emptyMap()
    ): String

    @POST
    @FormUrlEncoded
    suspend fun post(
            @Url url: String,
            @HeaderMap headers: Map<String, String> = emptyMap(),
            @FieldMap params: Map<String, String> = mapOf("z" to "z")
    ): String

    @PUT
    @FormUrlEncoded
    suspend fun put(
            @Url url: String,
            @HeaderMap headers: Map<String, String> = emptyMap(),
            @FieldMap params: Map<String, String> = mapOf("z" to "z")
    ): String

    @PATCH
    @FormUrlEncoded
    suspend fun patch(
            @Url url: String,
            @HeaderMap headers: Map<String, String> = emptyMap(),
            @FieldMap params: Map<String, String> = mapOf("z" to "z")
    ): String

    @DELETE
    suspend fun delete(
            @Url url: String,
            @HeaderMap headers: Map<String, String> = emptyMap(),
            @QueryMap map: Map<String, String> = emptyMap()
    ): String

    @GET
    @Streaming
    suspend fun download(@Url url: String): ResponseBody

}